package a.j;

import a.e.c;

import java.awt.geom.GeneralPath;
import java.awt.geom.Line2D;
import java.awt.geom.PathIterator;
import java.awt.geom.Point2D;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.HashMap;
import java.util.Map;

public class ub
  extends tb
{
  private float H;
  private float I;
  private float J;
  private float K;
  private float L;
  private float M;
  private float N;
  private float O;
  private float P;
  private float Q;
  private float R;
  private float S;
  private float T;
  private float U;
  private byte V;
  eb W;
  public static final byte X = 0;
  public static final byte Y = 1;
  public static int Z;
  
  public ub()
  {
    this((byte)1);
  }
  
  public ub(byte paramByte)
  {
    Z();
    this.V = paramByte;
  }
  
  public void s() {}
  
  public ub(tb paramtb)
  {
    super(paramtb);
    if ((bool2) || ((paramtb instanceof ub)))
    {
      ub localub = (ub)paramtb;
      this.V = localub.ab();
      this.L = localub.bb();
      this.M = localub.cb();
      if (!bool2)
      {
        if (localub.n() != 1)
        {
          this.W = new eb(this, 0.0D, 0.0D);
          if (bool2) {
            break label238;
          }
          if (!bool1) {}
        }
        else
        {
          this.W = new eb(this, localub.W.b(), localub.W.c());
          this.H = localub.H;
          this.J = localub.J;
          this.I = localub.I;
          this.K = localub.K;
          this.N = localub.N;
          this.O = localub.O;
          this.P = localub.P;
          this.Q = localub.Q;
          this.S = localub.S;
          this.R = localub.R;
          this.T = localub.T;
        }
      }
      else {
        this.U = localub.U;
      }
      this.D.clear();
      if (bool2) {
        break label242;
      }
      this.D.b(this.W);
      if (!bool1) {
        label238:
        return;
      }
    }
    label242:
    Z();
  }
  
  public tb b(tb paramtb)
  {
    return new ub(paramtb);
  }
  
  private void Z()
  {
    this.L = 1.0F;
    this.M = 30.0F;
    this.W = new eb(this, 0.0D, 0.0D);
    this.D.clear();
    this.D.b(this.W);
    this.V = 1;
  }
  
  public void b(byte paramByte)
  {
    if (!ld.E)
    {
      if (this.V != paramByte)
      {
        this.V = paramByte;
        db();
      }
    }
    else {
      Q();
    }
  }
  
  public byte ab()
  {
    return this.V;
  }
  
  public float bb()
  {
    return this.L;
  }
  
  public void a(float paramFloat)
  {
    this.L = paramFloat;
    Q();
  }
  
  public void b(float paramFloat)
  {
    this.M = paramFloat;
    Q();
  }
  
  public float cb()
  {
    return this.M;
  }
  
  public eb a(double paramDouble1, double paramDouble2, eb parameb, int paramInt)
  {
    return null;
  }
  
  public void a(eb parameb1, eb parameb2, int paramInt) {}
  
  public eb b(double paramDouble1, double paramDouble2)
  {
    return null;
  }
  
  public eb a(eb parameb)
  {
    return null;
  }
  
  public int r()
  {
    return 1;
  }
  
  public void a(eb parameb, double paramDouble1, double paramDouble2)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    if (!bool2) {
      if (!parameb.d()) {
        return;
      }
    }
    if (!bool2)
    {
      if (!g().H()) {
        if (bool2) {
          break label55;
        }
      }
    }
    else {
      if (!h().H()) {
        break label54;
      }
    }
    return;
    label54:
    label55:
    double d1 = Line2D.ptLineDist(this.H, this.I, this.J, this.K, this.W.b(), this.W.c());
    if (!bool2) {
      if (Double.isNaN(d1)) {
        d1 = (float)Math.sqrt((this.H - this.W.b()) * (this.H - this.W.b()) + (this.I - this.W.c()) * (this.I - this.W.c()));
      }
    }
    int i = Line2D.relativeCCW(this.H, this.I, this.J, this.K, this.W.b(), this.W.c());
    double d2 = (float)Math.sqrt(this.P * this.P + this.Q * this.Q);
    if (!bool2) {
      switch (this.V)
      {
      case 0: 
        if (!bool2)
        {
          if (i != 0)
          {
            this.M = (i * (float)d1);
            if (bool2) {
              return;
            }
            if (!bool1) {
              break;
            }
          }
          else
          {
            this.M = ((float)d1);
            if (bool2) {
              return;
            }
          }
        }
        else {
          if (!bool1) {
            break;
          }
        }
        break;
      case 1: 
        if (d2 > 0.0D) {
          this.L = (i * (float)(4.0D * d1 / d2));
        }
        break;
      }
    }
    db();
  }
  
  private void db()
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    if (!bool2)
    {
      if (i() != null) {
        if (bool2) {
          break label39;
        }
      }
    }
    else {
      if (i().c() != null) {
        break label38;
      }
    }
    return;
    label38:
    label39:
    ld localld1 = h();
    ld localld2 = g();
    zd localzd1 = k();
    zd localzd2 = l();
    this.H = ((float)localzd1.a(localld1));
    this.I = ((float)localzd1.b(localld1));
    this.J = ((float)localzd2.a(localld2));
    this.K = ((float)localzd2.b(localld2));
    this.P = (this.J - this.H);
    this.Q = (this.K - this.I);
    this.N = (this.H + this.P / 2.0F);
    this.O = (this.I + this.Q / 2.0F);
    if (!bool2)
    {
      switch (this.V)
      {
      case 1: 
        this.S = (this.Q * this.L / 4.0F);
        this.R = (-this.P * this.L / 4.0F);
        this.M = ((float)Math.sqrt(this.S * this.S + this.R * this.R));
        if (bool2) {
          break label447;
        }
        if (this.L < 0.0F)
        {
          this.M = (-this.M);
          if (bool2) {
            return;
          }
          if (!bool1) {
            break;
          }
        }
        break;
      case 0: 
        double d = Math.sqrt(this.P * this.P + this.Q * this.Q);
        if (!bool2)
        {
          if (d > 0.0D)
          {
            this.L = ((float)(this.M / d));
            this.S = (this.Q * this.L);
            this.R = (-this.P * this.L);
            this.L *= 4.0F;
            if (bool2) {
              return;
            }
            if (!bool1) {
              break;
            }
          }
          else
          {
            this.S = 0.0F;
          }
        }
        else {
          this.R = 0.0F;
        }
        break;
      }
      this.W.c = (this.N + this.S);
      this.W.d = (this.O + this.R);
      this.T = ((float)(this.W.b() + this.S));
    }
    label447:
    this.U = ((float)(this.W.c() + this.R));
  }
  
  protected byte a(Point2D paramPoint2D1, Point2D paramPoint2D2)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    db();
    GeneralPath localGeneralPath = new GeneralPath(1, 5);
    localGeneralPath.moveTo(this.H, this.I);
    localGeneralPath.quadTo(this.T, this.U, this.J, this.K);
    PathIterator localPathIterator = localGeneralPath.getPathIterator(null, 1.0D);
    float[] arrayOfFloat = hb.a().c;
    localPathIterator.currentSegment(arrayOfFloat);
    localPathIterator.next();
    this.E.reset();
    this.E.moveTo(arrayOfFloat[0], arrayOfFloat[1]);
    if (!localPathIterator.isDone())
    {
      if (!bool2)
      {
        localPathIterator.currentSegment(arrayOfFloat);
        localPathIterator.next();
      }
    }
    else {
      while (bool2)
      {
        if (bool1) {
          break label174;
        }
        this.E.lineTo(arrayOfFloat[0], arrayOfFloat[1]);
        if (!bool1) {
          break;
        }
      }
    }
    label174:
    return ye.a(this, this.E, this.E = new GeneralPath(1, n() + 4), paramPoint2D1, paramPoint2D2);
  }
  
  public static Map eb()
  {
    HashMap localHashMap = new HashMap(5);
    localHashMap.put(new Byte((byte)1), "Fixed Ratio");
    localHashMap.put(new Byte((byte)0), "Fixed Height");
    return localHashMap;
  }
  
  public void a(ObjectOutputStream paramObjectOutputStream)
    throws IOException
  {
    paramObjectOutputStream.writeByte(1);
    super.a(paramObjectOutputStream);
    paramObjectOutputStream.writeByte(this.V);
    paramObjectOutputStream.writeFloat(this.L);
    paramObjectOutputStream.writeFloat(this.M);
  }
  
  public void a(ObjectInputStream paramObjectInputStream)
    throws IOException, ClassNotFoundException
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    if (!bool2) {}
    byte b;
    switch (paramObjectInputStream.readByte())
    {
    case 0: 
      paramObjectInputStream.readByte();
      super.a(paramObjectInputStream);
      b = paramObjectInputStream.readByte();
      this.L = paramObjectInputStream.readFloat();
      this.M = paramObjectInputStream.readFloat();
      b(b);
      if (bool2) {
        return;
      }
      if (!bool1) {
        break;
      }
    case 1: 
      super.a(paramObjectInputStream);
      b = paramObjectInputStream.readByte();
      this.L = paramObjectInputStream.readFloat();
      this.M = paramObjectInputStream.readFloat();
      b(b);
      if (bool2) {
        return;
      }
      if (!bool1) {
        break;
      }
    default: 
      throw new c();
    }
    db();
    Q();
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.j.ub

 * JD-Core Version:    0.7.0.1

 */